import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { SortsService } from './sorts.service';
import { CreateSortDto } from './dto/create-sort.dto';
import { UpdateSortDto } from './dto/update-sort.dto';

@Controller('sorts')
export class SortsController {
  constructor(private readonly sortsService: SortsService) {}

  @Post()
  create(@Body() createSortDto: CreateSortDto) {
    return this.sortsService.create(createSortDto);
  }

  @Get()
  findAll() {
    return this.sortsService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.sortsService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateSortDto: UpdateSortDto) {
    return this.sortsService.update(+id, updateSortDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.sortsService.remove(+id);
  }
}
